# h)	元组定义
#     1.	Mytuple = ()
#     2.	Mytuple = tuple()
#     3.	Mytuple = (1)    错误用法
#     4.	Mytuple = (1,)   如果只有一个对象 应该这样写
# i)	元组嵌套
#     1.	Mytuple1 = ()
#     2.	Mytuple2 = (Mytuple1,(1,2),[1,2,3])
# j)	元组方法
#     1.	count
#     2.	index


# 索引取值   范围取值 成员判断 和列表相同 


# 元组和列表都可以通过 解包 使用在不定长参数的函数中

import time

def f_tuple(n=1000000):
    for i in range(n):
        a = (1,2,3,4,5)
        b = a

def f_list(n=1000000):
    for i in range(n):
        a = [1,2,3,4,5]
        b = a

def time_test():
    t1 = time.time()
    f_tuple()
    t2 = time.time()
    print(t2-t1)
    t1 = time.time()
    f_list()
    t2 = time.time()
    print(t2-t1)

time_test()
